package com.khaled.protclass.model.loader;

import java.io.IOException;
import java.util.ArrayList;

import com.khaled.protclass.model.base.IProtein;
import com.khaled.protclass.model.bean.protein.ProteinType;

/**
 * @author hassankh
 * 
 */
public abstract class ProteinLoader
{
	private static ProteinLoader proteinLoader;

	public abstract ArrayList<IProtein> loadProteins(String path, String proteinClass) throws IOException;
	
	public abstract ArrayList<IProtein> loadProteinsFromString(String proteinSequence, String proteinClass);

	public static ProteinLoader getInstance(ProteinType proType)
	{
		if (proteinLoader == null)
		{
			if (proType.isSequence())
			{
				proteinLoader = new SequenceProteinLoader();
			}
			else if (proType.isSequence())
			{
				proteinLoader = new StructureProteinLoader();
			}
		}
		return proteinLoader;
	}
}
